<script setup>
import { constant } from 'lodash'
import { reactive, ref, watchEffect } from 'vue-demi'
import { Search } from '@element-plus/icons-vue'
const activeName = ref('summary')
const ruleFormRef = ref(null)
const props = defineProps({
  data: {
    type: Object,
    default: {}
  }
})

// 表格数据
const TableData = ref([])

// 右边表单 字段
const rightForm = reactive({})

// 回显数据赋值
watchEffect(() => {
  if (typeof props.data == 'object' && props.data?.id) {
    // console.log(props.data)
    for (let Key in props.data) {
      rightForm[Key] = props.data[Key]
    }
  }
})
</script>

<template>
  <div class="app-container">
    <!-- 右边表单 -->
    <el-form :model="rightForm" label-width="120px" class="demo-ruleForm" status-icon inline>
      <el-form-item label="类别">
        <el-input v-model="rightForm.warehouseTypeDict" disabled />
      </el-form-item>
      <el-form-item label="上级编码">
        <el-input v-model="rightForm.parentCode" disabled />
      </el-form-item>
      <el-form-item label="编码">
        <el-input v-model="rightForm.warehouseCode" disabled />
      </el-form-item>
      <el-form-item label="名称">
        <el-input v-model="rightForm.warehouseName" disabled />
      </el-form-item>
      <el-form-item label="容积(立方米)">
        <el-input v-model="rightForm.volume" disabled />
      </el-form-item>
      <el-form-item label="容量(吨)">
        <el-input v-model="rightForm.capacity" disabled />
      </el-form-item>
      <div>
        <el-form-item label="不良区域">
          <p-switch v-model="rightForm.badArea" disabled />
        </el-form-item>
      </div>
      <div class="flex-items-center textareaClass">
        <el-form-item label="备注">
          <el-input
            type="textarea"
            disabled
            v-model="rightForm.remark"
            :input-style="{
              width: '100%'
            }"
          />
        </el-form-item>
      </div>
    </el-form>
  </div>
</template>
<style scoped>
.title {
  color: #3985fb;
}
label {
  display: inline-block;
  width: 120px;
  text-align: right;
  padding-right: 12px;
}
</style>
